Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Time Base Functions / Time Base Callback Functions


NewCallBack

The NewCallback function creates a new callback event. The callback event created at this time is not active until you schedule it by calling the CallMeWhen function, which is described in the next section.

WARNING
You must not call this function at interrupt time.
pascal QTCallBack NewCallBack (TimeBase tb, short cbType);
tb
Specifies the callback event's time base. You obtain this identifier from the NewTimeBase function (described on page 2-297).
cbType
Specifies when the callback event is to be invoked. The value of this field governs how the Movie Toolbox interprets the data supplied in the param1, param2, and param3 parameters to the CallMeWhen function, which is described in the next section. The following values are valid for this parameter:
callBackAtTime
Indicates that the event is to be invoked at a specified time.
callBackAtRate
Indicates that the event is to be invoked when the rate for the time base reaches a specified value.
callBackAtTimeJump
Indicates that the event is to be invoked when the time base's time value changes by an amount that differs from its rate.
callBackAtExtremes
Indicates that the event is to be invoked when the time base reaches its start time or its stop time. If the start or stop time of the time base changes, the call back is automatically rescheduled. This is very useful for looping or determining when a movie is complete. You determine when the callback is to be fired with the triggerAtStart and triggerAtStop constants. Both flags may be set.
In addition, if the high-order bit of the cbType parameter is set to 1 (this bit is defined by the callBackAtInterrupt flag), the event can be invoked at interrupt time.
DESCRIPTION
The NewCallBack function returns a reference to the new callback event. You must provide this reference to other Movie Toolbox functions described in this section. If the Movie Toolbox cannot create the callback event, this function returns nil.

ERROR CODES
None


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996